package iit.projects.etaxi.view.bean;

import iit.projects.etaxi.util.JSFUtils;

import javax.faces.event.ActionEvent;

public class ConfirmationPopupBackingBean{

	private String backingBeanAlias = null;
	private String methodName = null;
	private boolean showPopup;
	private String message;
	
	
	public void setShowPopup(boolean value) {
		showPopup = value;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean isShowPopup() {
		return showPopup;
	}
	
	public void approve(ActionEvent e){
		JSFUtils.invokeManageBeanActionListernerMethod(getBackingBeanAlias(),getMethodName(),e);
		clearBean();
	}
	
	public void cancel(ActionEvent e){
		showPopup = false;
	}
	
	private void clearBean(){
		backingBeanAlias = null;
		methodName = null;
		showPopup = false;
	}

	public String getBackingBeanAlias() {
		return backingBeanAlias;
	}

	public void setBackingBeanAlias(String backingBeanAlias) {
		this.backingBeanAlias = backingBeanAlias;
	}

	public String getMethodName() {
		return methodName;
	}

	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}
}
